﻿<%@ Page Title="Quản lý đơn đặt hàng" Language="C#" MasterPageFile="~/Admin/Admin.master"
    AutoEventWireup="true" CodeFile="DonDatHang.aspx.cs" Inherits="Admin_DonDatHang" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        fieldset
        {
            -webkit-border-radius: 5px;
            margin-top: 5px;
            width: 96%;
        }
        .GV1
        {
            border: 1px solid #333;
            border-left-style: hidden;
            border-right-style: hidden;
        }
        .Hyperlink{ color:White; text-decoration:none;}
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="pn1" runat="server">
        <ContentTemplate>
            <div class="tieude">
                Quản lý đơn đặt hàng</div>
            <div style="width: 100%; min-height:300px; margin-top: 10px; margin-left: 5px; margin-bottom:10px; overflow: auto;" class="wrapper">
                <asp:GridView ID="gvDonDatHang" Width="99%" runat="server" CssClass="GV1"
                    AutoGenerateColumns="false" BorderStyle="None" BorderWidth="1px" CellPadding="3" ForeColor="White"
                    EnableModelValidation="True" EmptyDataText="Không có đơn đặt hàng nào" OnRowCommand="gvDonDatHang_RowCommand">
                    <Columns>
                        <asp:TemplateField HeaderText="Xóa" HeaderStyle-HorizontalAlign="Left">
                            <ItemTemplate>
                                <asp:ImageButton ID="lbXoa" runat="server" Width="20px" Height="20px" ImageUrl="~/Img/delete-24.png"
                                    OnClientClick="return confirm('Bạn chắc chắn muốn xóa ?')" CommandArgument='<%#Eval("ID")%>'
                                    Text="Xóa" CommandName="Del" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" ForeColor="White" />
                            <HeaderStyle HorizontalAlign="Center" ForeColor="White" Width="40px" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Khách hàng">
                            <ItemTemplate>
                                <asp:Label ID="lbKhachHang" runat="server" Text='<%#Eval("HoTenKH") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="rows" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Địa chỉ">
                            <ItemTemplate>
                                <asp:Label ID="lbDiaChi" runat="server" Text='<%#Eval("DiaChi") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="rows" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Số điện thoại">
                            <ItemTemplate>
                                <asp:Label ID="lbSDT" runat="server" Text='<%#Eval("SoDienThoai") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="rows" Width="100px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Email">
                            <ItemTemplate>
                                <asp:Label ID="lbEmail" runat="server" Text='<%#Eval("Email") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="rows" Width="100px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Yêu cầu">
                            <ItemTemplate>
                                <asp:Label ID="lbYeuCau" runat="server" Text='<%#Eval("NoiDung") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="rows" Width="100px" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="NgayDatHang" HeaderText="Ngày đặt hàng" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="100px" DataFormatString="{0:dd/MM/yyyy}" />
                        <asp:TemplateField HeaderText="Chi tiết đặt hàng">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkChiTiet" runat="server" CssClass="Hyperlink" CommandName="Select" CommandArgument='<%#Eval("ID")%>'
                                    Text="Xem chi tiết"></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle CssClass="rows" Width="115px" HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    
                </asp:GridView>
                <asp:HiddenField ID="hdID" runat="server" />
            
            <fieldset id="fChiTiet" runat="server" visible="false">
                <legend style="color: White;">Chi tiết đơn đặt hàng</legend>
                <asp:GridView ID="gvChiTiet" Width="99%" runat="server" CssClass="GV1" ForeColor="White"
                    AutoGenerateColumns="false" EmptyDataText="Không có sản phẩm nào"
                    BorderStyle="None" BorderWidth="1px" CellPadding="3" EnableModelValidation="True">
                    <Columns>
                        <asp:TemplateField HeaderText="Sản phẩm">
                            <ItemTemplate>
                                <asp:Label ID="lbSP" runat="server" Text='<%#Eval("Tensp") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="rows" HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Số lượng">
                            <ItemTemplate>
                                <asp:Label ID="lbSL" runat="server" Text='<%#Eval("SoLuong") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="rows" Width="100px" HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </fieldset>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
